package cn.tedu.ivos.audit.controller;

import cn.tedu.ivos.audit.pojo.dto.AuditQuery;
import cn.tedu.ivos.audit.pojo.dto.AuditSaveParam;
import cn.tedu.ivos.audit.pojo.vo.AuditVO;
import cn.tedu.ivos.audit.service.AuditService;
import cn.tedu.ivos.base.response.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/v1/audit")
public class AuditController {
    @Autowired
    private AuditService auditService;

    @GetMapping("/select")
    public JsonResult selectAudit(AuditQuery auditQuery){
      List<AuditVO> auditVOList = auditService.selectAudits(auditQuery);
      return JsonResult.ok(auditVOList);
    }
    //修改审核状态
    @PostMapping("/update")
    public JsonResult updateAudit(AuditSaveParam saveParam){
        auditService.updateAudit(saveParam);
        return JsonResult.ok();
    }
}
